<template>
  <div class="template-demo">
    <h3>{{ msg }}</h3>
    <h3>------------------</h3>
    <h3>模板语法</h3>
    <h3>{{ curMsg }}</h3>
    <h3>{{ rawHtml }}</h3>
    <h3 v-html="rawHtml"></h3>
    <h3>{{ otherMsg.split("").reverse().join("") }}</h3>
  </div>
</template>

<script>
export default {
  name: "TemplateSyntax",
  props: {
    msg: String,
  },
  data() {
    return {
      curMsg: "语法显示",
      rawHtml: "<a href='http://www.baidu.com'>百度</a>",
      otherMsg: "大家好!",
    };
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
